
<script>
    $(function() {
        $("#cari").click(function(event) {
            var v_bulan =document.getElementById('bulan').value;
            $.ajax({
                url: '<?php echo base_url(); ?>index.php/content_ajax/ajax_rekap_transaksi',
                type: "POST",
                data: {
                    bulan: v_bulan,
                    '<?php echo $this->security->get_csrf_token_name(); ?>': '<?php echo $this->security->get_csrf_hash(); ?>'
                },
                success: function(result)
                {
                    
                    var obres = $.parseJSON(result);
                    var err_code = obres.err_code;
                    var data_html = obres.data_html;
                    if (err_code !== "00") {
                        alert(obres.msg);
                    }
                    else
                    {
                        document.getElementById("tabel_transaksi").innerHTML=data_html;
                    }
                },
                error: function()
                {
                    alert("Gagal melakukan pencarian, silahkan ulangi sekali lagi");
                }
            });
        });
    });
</script>


<div id="templatemo_upcomming_event" class="container_wapper">
    <div class="container">
        <h1 align="center" style="font-family: calibri; margin-bottom: 20px;"> -------------------Rekapitulasi Transaksi-------------------</h1>
        <table id="table-content" style="width: 100%;" border="0">
            <tr>
                <td align="right">Bulan</td>
                <td>:</td>
                <td>
                    <select id="bulan" name="bulan">
                        <option value="<?php echo date("Y");?>-01"> Januari </option>
                        <option value="<?php echo date("Y");?>-02"> Februari </option>
                        <option value="<?php echo date("Y");?>-03"> Maret </option>
                        <option value="<?php echo date("Y");?>-04"> April </option>
                        <option value="<?php echo date("Y");?>-05"> Mei </option>
                        <option value="<?php echo date("Y");?>-06"> Juni </option>
                        <option value="<?php echo date("Y");?>-07"> Juli </option>
                        <option value="<?php echo date("Y");?>-08"> Agustus </option>
                        <option value="<?php echo date("Y");?>-09"> September </option>
                        <option value="<?php echo date("Y");?>-10"> Oktober </option>
                        <option value="<?php echo date("Y");?>-11"> November </option>
                        <option value="<?php echo date("Y");?>-12"> Desember </option>
                    </select>
                </td>
            </tr>
            <input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>"/>
            <tr>
                <td></td>
                <td></td>
                <td>
                    <input type="button" class="button_blue" id="cari" name="cari" value="Cari"/>
                </td>
            </tr>
            <tr>
                <td colspan="4">&nbsp;</td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td>
                    <div id="tabel_transaksi"></div>
                </td>
            </tr>
        </table>
    </div>
</div>
</body>
</html>



